<template>
  <div id="top">
    <div class="top">
      <div class="topleft">
        <div class="text">佛教后台</div>
        
      </div>
      <div class="logout" @click="logout">安全退出</div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'top',
  data () {
    return {
    };
  },
  methods: {
    logout() {
      this.$api.apiLoginOut({}, res => {
        this.$message({
          type: 'info',
          message: '已退出登录，请重新登录'
        })
        sessionStorage.clear()
        this.$router.push('/login')
      })
      
    }
  }
};
</script>

<style lang="scss">
  #top {
    .top {
      height: 70px;
      background-color: #545c64;
      box-sizing: border-box;
      padding-left: 36px;
      padding-right: 184px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      .topleft {
        height: 70px;
        display: flex;
        justify-content: flex-start;
        align-items: center;
        .text {
          font-size:28px;
          color: white;
          margin-left: 20px;
        }
      }
      .logout {
          color: wheat;
          &:hover {
            cursor: pointer;
          }
          position: relative;
          left: 100px;
      }
     
    }
  }
</style>
